<?php
namespace app\controller;

use app\BaseController;
use app\pub\ErrJson;
use think\facade\Cache;
use think\facade\Session;

class Index extends BaseController
{
    /**
     * 生产环境
     */
//    public function login(){
//        global $_W,$_GPC;
//        $uniacid = $_W['uniacid']; // 当前公众号ID
//        $user = $_W['user'];
//        session('name', 'thinkphp');
//        $data = array(
//            'uniacid' => $uniacid,
//            'user' => $user
//        );
//        return ErrJson::success_json($data);
//    }

    /**
     * VUE开发的时候的模拟登录信息
     */
     public function login(){

         $uniacid = 1; // 当前公众号ID
         $user = array(
             'uid' => 1,
             'owner_uid' => '0',
 			'groupid' => 1,
 			'founder_groupid' => 0,
             'username' => 'benhailong',
             'type' => '0',
             'status' => '0',
             'joindate' => '1585238006',
             'joinip' => '',
             'lastvisit' => '1585238795',
             'lastip' => '121.225.18.60',
             'remark' => '',
             'starttime' => '0',
             'endtime' => '0',
             'register_type' => '0',
             'openid' => '',
             'welcome_link' => '0',
             'notice_setting' => [],
             'avatar' => null,
             'hash' => 'a3c19daab0e5ce583e66064efc03bea3',
             'name' => 'benhailong',
             'clerk_id' => '1',
             'store_id' => 0,
             'clerk_type' => '2',
             'currentvisit' => '1595345717',
             'currentip' => '121.225.17.254'
         );
         $data = array(
             'uniacid' => $uniacid,
             'user' => $user
         );
         return ErrJson::success_json($data);
     }
}
